<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <script src="../vue.js"></script>
    <style>
      .outer {
        display: flex;
        list-style: none;
      }
      .outer li {
        width: 20px;
        height: 20px;
        background-color: #ccc;
        margin: 0 10px;
      }
    </style>
  </head>

  <body>
    <div id="app">
      <!-- 不推荐在同一元素上使用 v-if 和 v-for -->
      <ul class="outer">
        <li v-for="item in page" :key="item" v-if="item>=5">{{item}}</li>
      </ul>
    </div>
    <script>
      Vue.config.productionTip = false;

      const vm = new Vue({
        el: "#app",
        data() {
          return {
            page: [5, 6, 7, 8, 9, 10],
          };
        },
      });
    </script>
  </body>
</html>
